package com.diandian.backend.store.param;

import com.diandian.backend.store.dto.StoreKuaishouLifeStoreInfoDetailParamDTO;
import com.diandian.base.boot.starter.exception.DefaultException;

import java.io.Serializable;

public class StoreKuaishouLifeStoreInfoDetailByCodeParam implements Serializable {

	private String offlineCode;
	private String onlineCode;
	private String belong;

	public void check(){
		if((this.offlineCode == null || "".equals(offlineCode)) && (this.onlineCode == null || "".equals(onlineCode))){
			throw new DefaultException("线上和线下门店编码不能同时为空");
		}
		if(this.belong == null || "".equals(this.belong)){
			throw new DefaultException("归属标识不合法");
		}
	}

	public StoreKuaishouLifeStoreInfoDetailParamDTO toDTO(){
		StoreKuaishouLifeStoreInfoDetailParamDTO dto = new StoreKuaishouLifeStoreInfoDetailParamDTO();
		dto.setOfflineCode(this.offlineCode);
		dto.setOnlineCode(this.onlineCode);
		dto.setBelong(this.belong);
		return dto;
	}

	public String getOfflineCode() {
		return offlineCode;
	}
	public String setOfflineCode(String offlineCode) {
		return this.offlineCode = offlineCode;
	}
	public String getOnlineCode() {
		return onlineCode;
	}
	public String setOnlineCode(String onlineCode) {
		return this.onlineCode = onlineCode;
	}

	public String getBelong() {
		return belong;
	}

	public void setBelong(String belong) {
		this.belong = belong;
	}
}
